﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Lifang.Entites
{
    public class BaseEntity
    {

        /// <summary>
        /// 主键
        /// </summary>
        [My(PrimaryKey = true, Type = "自动增长")]
        public int Id { get; set; }

        /// <summary>
        /// 是否删除(0:未删除;1:已删除)
        /// </summary>
        public int IsDel { get; set; } = 0;

        /// <summary>
        /// 有效性(0:无效;1:有效)
        /// </summary>
        public int DataFlag { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateDateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 创建人工号
        /// </summary>
        public string CreateUserNo { get; set; } = string.Empty;
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUserName { get; set; } = string.Empty;

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateDateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 更新人工号
        /// </summary>
        public string UpdateUserNo { get; set; } = string.Empty;
        /// <summary>
        /// 更新人
        /// </summary>
        public string UpdateUserName { get; set; } = string.Empty;

        /// <summary>
        /// 数据库名称
        /// </summary>
        public readonly string DbName = "LifangDB";

        /// <summary>
        /// 表名
        /// </summary>
        [My(Ignore =true)]
        public string TableName { get; set; }

    }

    //自定义注解类
    public class MyAttribute : Attribute
    {
        public bool PrimaryKey = false;

        public bool Ignore = false;

        public String Type = null;
    }
}
